package com.phalanxim.service;

/**
 * Created with IntelliJ IDEA.
 * User: Zhendong
 * Date: 10/8/12
 * Time: 10:35 PM
 * To change this template use File | Settings | File Templates.
 */
public enum AddressType
{
  MAILING(1), BILLING(10), UNKNOWN(-1);

  private int value = -1;

  AddressType(int value) {
    this.value = value;
  }

  public int getValue() {
    return value;
  }

  public static AddressType forCode(int value)
  {
    for(AddressType type : AddressType.values())
    {
      if(value == type.value)
      {
        return  type;
      }
    }
    return AddressType.UNKNOWN;
  }
}
